<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>添加</title>
    <link href="../../layuiadmin/js/adm/css/bootstrap.css" rel="stylesheet">
    <script src="../../layuiadmin/js/adm/js/vue.js"></script>
    <script src="../../layuiadmin/js/adm/js/vue-resource.js"></script>
    <script src="../../layuiadmin/js/adm/js/jquery.min.js"></script>
    <script src="../../layuiadmin/js/adm/js/bootstrap.js"></script>
    <script src="../../layuiadmin/js/adm/js/getUrlParam.js"></script>
    <script src="../../layuiadmin/js/adm/js/date.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui@1.4/lib/theme-default/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui@1.4/lib/index.js"></script>
    <script src="../../layuiadmin/js/adm/js/jquery.cookie.js"></script>


    <style>
        td{
           padding-left: 10px
        }
    </style>
</head>
<body>
    
    <div id="app"   class="container-fluid" style="margin: 20px 8%">
        <h4 style="size: 30px;margin-top: 30px"><b>丨基本资料</b></h4>
        <table border="1px" style="width: 100%;height: 170px;border: none;margin: 10px 0 0 15px" >
            <tr>
                <td>
                   <span style="color: darkgray">收件人：</span><br>
                   {{register.empId.empName}}
                </td>
                <td>
                    <span style="color: darkgray">收件日期：</span><br>
                    {{register.receipt}}
                </td>
                <td>
                    <span style="color: darkgray">收件来源：</span><br>
                    {{register.companyId.companyName}}
                </td>
            </tr>
            <tr>
                <td>
                    <span style="color: darkgray">快件类型：</span><br>
                    {{register.espressId.espressName}}
                </td>
                <td>
                    <span style="color: darkgray">领件状态：</span><br>
                    <span v-if="register.state=='Y'">已领件</span>
                    <span v-if="register.state=='N'">已领件</span>
                </td>
                <td style="border:none"></td>
            </tr>
        </table>

        <h4 style="size: 30px;margin-top: 30px"><b>丨详细信息</b></h4>
        <table border="1px" style="width: 100%;height: 270px;border: none;margin: 15px 0 0 15px" >
            <tr>
                <td>
                    <span style="color: darkgray">案件：</span><br>
                    {{register.caseId.caseId}}
                </td>
                <td>
                    <span style="color: darkgray">快递单号：</span><br>
                    {{register.numbers}}
                </td>
                <td>
                    <span style="color: darkgray">快递费：</span><br>
                    {{register.cost}}
                </td>
            </tr>
            <tr>
                <td>
                    <span style="color: darkgray">领件人：</span><br>
                    {{register.lempId.empName}}
                </td>
                <td>
                    <span style="color: darkgray">领件时间：</span><br>
                    {{register.drawTime}}
                </td>
                <td>

                </td>
            </tr>
            <tr>
                <td colspan="3">
                    <span style="color: darkgray">备注说明：</span><br>
                    {{register.remark}}
                </td>
            </tr>
        </table>

    </div>
    

    <script>
          var vm=new Vue({
            el:'#app',
            data:{
                register:{
                    registerId:"",
                    empId:{
                        empName:""
                    },
                    receipt:"",
                    companyId:{
                        companyName:""
                    },
                    espressId:{
                        espressName:""
                    },
                    state:"",
                    caseId:{
                        caseId:""
                    },
                    numbers:"",
                    cost:"",
                    lempId:{
                        empName:""
                    },
                    uploading:"",
                    drawTime:"",
                    remark:""
                }
            },
            methods: {
                postinfo(id){
                    this.$http.post('http://localhost:8080/register/getbyid',{"id":id},{emulateJSON:true}).then(result =>{
                     var dat=eval("("+result.body+")")
                       this.register=dat
                       if(dat.caseId==null||dat.caseId==""){
                                var caseId={
                                    caseId:""
                                }
                                this.register.caseId=caseId
                        }
                        if(dat.lempId==null||dat.lempId==""){
                            var lempId={
                                empId:"",
                                empName:""
                            }
                            this.register.lempId=lempId
                        }

                    })
                }
            },
            created () {
                var id = getUrlParam("id")
                this.postinfo(id)
            },
            filters: {
                formatDate: function (value) {      //将时间戳修改为时间单位格式
                    let date = new Date(value);
                    let y = date.getFullYear();
                    let MM = date.getMonth() + 1;
                    MM = MM < 10 ? ('0' + MM) : MM;
                    let d = date.getDate();
                    d = d < 10 ? ('0' + d) : d;
                    let h = date.getHours();
                    h = h < 10 ? ('0' + h) : h;
                    let m = date.getMinutes();
                    m = m < 10 ? ('0' + m) : m;
                    let s = date.getSeconds();
                    s = s < 10 ? ('0' + s) : s;
                    return y + '-' + MM + '-' + d ;
                    // return y + '-' + MM + '-' + d + 'T' + h + ':' + m ;
                }
            }
        })      
    </script>

</body>
</html>